<?php
 $email=$_POST['email'];
 $pwd=$_POST['pwd'];

 include_once '../../common/sql.php';
 $conn=connect();
 $sql="select * from users where email='$email'and password='$pwd'";
 $arr=query($conn,$sql);
 
$res=array('code'=>0,'msg'=>'登录失败');
 if($arr){

     session_start();
     $_SESSION['userinfo']= $arr[0];
 
     $res['code']=1;
     $res['msg']='登录成功';
 }
  echo json_encode($res);

 ?>